<?php
// main module of VRML representation

function getmicrotime(){
    list($usec, $sec) = explode(" ",microtime());
    return ((float)$usec + (float)$sec);
}

function show_vrml() {
    $generationtime = getmicrotime();
    global $_GET, $session_id;
    include_once 'generation.php';
    include_once 'html_text.php';
    $viewpoints = Array();
    if ((isset($_GET["cid"])) && ($_GET["cid"] > 0))
        $ret_data = generation_code($_GET["uid"], $viewpoints, $_GET["cid"]);
    else
        $ret_data = generation_code($_GET["uid"], $viewpoints, 0);
    if (isset($_GET["world"]) && $_GET["world"] == 1) {
//        header ("Content-Type: model/vrml");
        header ("Content-Type: text/html");
    } else {
        header ("Content-Type: text/html");
        $ret_data = return_html($viewpoints);
    }
    //$generationtime = getmicrotime() - $generationtime;
    //if (!$file=fopen('ontoedit/time.log', "w")){
          //        echo("<script>alert('Could not create file time.log');</script>");
    //}else{
    //  fwrite($file, "Time of generation VRML code:\n".$generationtime);
    //  fclose($file);
    //};
    return $ret_data;
}
?>